package com.jsfcompref.solutech.backing;

import javax.ejb.EJB;
import javax.faces.application.Application;
import javax.faces.context.FacesContext;

import com.eCommerce.corecontract.dto.ComposantDTO;
import com.ecommerceWeb.common.JSFUtil;
import com.jsfcompref.solutech.model.PanierAchatBean;
import com.jsfcompref.solutech.model.PanierAchatLocal;

public class FicheComposant {
	
	@EJB
	private PanierAchatLocal panierAchat;
	
	public String addComposantToPanier(){
		FacesContext ctx = FacesContext.getCurrentInstance();
		Application app = ctx.getApplication();
		ComposantDTO composant = (ComposantDTO)JSFUtil.getManagedObject("GetComposant");
		panierAchat.ajouterComposant(composant);
		return "composant.added";
	}

}
